home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d7 / exechk.arc / MYPROG.PAS < prev   
Pascal/Delphi Source File  |  1990-12-06  |  2KB  |  57 lines

  1. (*******************************************************************
  2. Program/Unit                 MYPROG.PAS
  3. Written                      06 Dec 90
  4. Revised                      .........
  5. Author                       Johnathan J. Stein
  6.                              PO Box 346
  7.                              Perrysburg, OH  43551
  8.                              CompuServe 76576,470
  9. Purpose                      To illustrate how to implement EXE
  10.                              file "stamping", in order to discourage
  11.                              illegal copying WITHOUT using copy protection.
  12. Contents
  13. --------
  14. Sample application program, which uses "MyExeCheck" to make sure that
  15. the installation program has been run to "stamp" the user-specific
  16. information onto the EXE file.
  17.  
  18. Both the installation and application program share data display routines.
  19. *******************************************************************)
  20. USES Crt,
  21.      exechk ;
  22.  
  23. {$I mydata.inc }                                 (* Only need Data Display *)
  24.  
  25. procedure MyExeCheck ( S : string ) ;
  26. begin
  27.    MyDataInit ;
  28.    (*******************************************************************
  29.    Here is where your program checks for the user-data to be "stamped"
  30.    *******************************************************************)
  31.    if not IsExePersonalized ( S ) then
  32.    begin
  33.       writeln ( 'Program must be installed properly!' ) ;
  34.       writeln ( 'Please consult your manual.' ) ;
  35.       halt ( 1 ) ;
  36.    end ;
  37.    ExeReadData ( S ,
  38.                  Data ,
  39.                  SizeOf ( Data ) ) ;          (* Get info from EXE file *)
  40.    MyDataOutput ;                             (* Display user info *)
  41. end ;
  42.  
  43. procedure MyMainRoutine ;
  44. begin
  45.    writeln ( 'My program is running!' ) ;
  46. end ;
  47.  
  48. begin
  49.    (*******************************************************************
  50.    NOTE:  Under DOS 3.x and higher, the program name is returned by
  51.    ParamStr ( 0 ).  This is NOT true for prior versions of DOS.
  52.    *******************************************************************)
  53.    MyExeCheck ( ParamStr ( 0 ) ) ;
  54.    FileMode                  := 2 ;              (* Reset to TP default *)
  55.    MyMainRoutine ;
  56. end .
  57.